{% extends "base.html" %}
{% block content %}
{%  for bulletin in bulletins%}
<div class="article" style="position: relative">
    <h1>{{bulletin.title}}</h1>
    <div class="">
        &nbsp;
        <span class="c_888 f12">{{bulletin.dt}}</span>
        &nbsp;&nbsp;&nbsp;
        <span class="c_888 f12">{{bulletin.source}}</span>
        &nbsp;&nbsp;&nbsp;
        {% if current_user.role_id == 1 or current_user.id == bulletin.author_id %}
        <a class="btn btn-app" href="/bd/view_bulletin?id={{bulletin.id}}"><i class="fa fa-edit"></i> 编辑</a>
        {% endif %}
    </div>
</div>
<div class="bd">
{% if bulletin.bulletinimages and bulletin.bulletinimages|length >1 %}
<div class="banner" id="b04">
    <ul>
        {% for image in bulletin.bulletinimages%}
        <li><img src="{{"/bd/web/static/"+image.file}}" width="640" height="400" ></li>
        {% endfor%}
        <a href="javascript:void(0);" class="unslider-arrow04 prev"><img class="arrow" id="al" src="/bd/web/static/arrowl.png" alt="prev" width="20" height="35"></a>
        <a href="javascript:void(0);" class="unslider-arrow04 next"><img class="arrow" id="ar" src="/bd/web/static/arrowr.png" alt="next" width="20" height="37"></a>

    </ul>
</div>
{% else%}
<div>
    <ul><img src="{{"/bd/web/static/"+bulletin.bulletinimages.file}}" width="640" height="400" ></ul>
</div>
{% endif %}
    <br>
    <p class="f16">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{bulletin.content}}
    </p>
</div>
{% endfor %}

{% endblock %}
{% block script %}
<script>
    $(document).ready(function(e) {
        var unslider04 = $('#b04').unslider({
                    dots: true
                }),
                data04 = unslider04.data('unslider');
        $('.unslider-arrow04').click(function() {
            var fn = this.className.split(' ')[1];
            data04[fn]();
        });
    });
</script>
{% endblock %}